//
//  HZJBaseNavigationController.swift
//  HZJGTEST
//
//  Created by 运车管家 on 2017/8/26.
//  Copyright © 2017年 运车管家. All rights reserved.
//

import UIKit

class HZJBaseNavigationController: UINavigationController,UIGestureRecognizerDelegate {
    var leftBtn:UIButton?
    
    override func viewDidLoad() {
        super.viewDidLoad()
//        self.navigationBar.tintColor = .brown
//        self.navigationBar.isTranslucent = true
//        self.navigationBar.setBackgroundImage(UIImage(), for: .default)
    }
    override func pushViewController(_ viewController: UIViewController, animated: Bool) {
        self.interactivePopGestureRecognizer?.delegate = self
        if self.viewControllers.count > 0 {
            viewController.hidesBottomBarWhenPushed = true
        }
        super.pushViewController(viewController, animated: animated)
    }
    
    func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
        guard self.children.count == 1 else {
            return true
        }
        guard gestureRecognizer.isKind(of:(UIPanGestureRecognizer.classForCoder())) else{
            return true
        }
        return false
    }
    func clickTheLeftBtn(btn:UIButton) {
        self.popViewController(animated: true)
    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

}
